import httpInstance from "@/utils/http.js";

//创建订单
export function createOrderAPI(orderList){
    return httpInstance({
        url:'/order/createOrder',
        method:'post',
        data: orderList,
    })
}

//获取订单
export function getOrderListAPI(uid){
    return httpInstance({
        url:`/order/userOrderList/uid=${uid}`,
        method:'get',
    })
}



//获取详细订单
export function getDetailOrderListAPI(uid){
    return httpInstance({
        url:`/order/userOrderDetailedList`,
        method:'get',
        params:{
            uid:uid
        }
    })
}

//更新订单状态
export function updateOrderAPI(oid,status){
    return httpInstance({
        url:`/order/orderStatus`,
        method:'put',
        params:{
            oid:oid,
            status:status
        }
    })
}

// 获取商铺订单列表
export function getShopOrdersAPI(shopId){
  return httpInstance({
    url: '/order/shopOrderList',
    method: 'get',
    params: {
        shop_id:shopId
    }
  })
}
